package service

import (
	"context"
	"github.com/go-kratos/kratos/v2/log"
	"rosebox/internal/biz"

	pb "rosebox/api/rosebox"
)

type GatewayService struct {
	pb.UnimplementedGatewayServer

	uc  *biz.GatewayUseCase
	log *log.Helper
}

func NewGatewayService(uc *biz.GatewayUseCase, logger log.Logger) *GatewayService {
	return &GatewayService{log: log.NewHelper(logger), uc: uc}
}

func (s *GatewayService) ConnGateway(ctx context.Context, req *pb.ConnGatewayRequest) (*pb.ConnGatewayReply, error) {
	value, err := s.uc.Create(ctx)
	if err != nil {
		return nil, err
	}
	return &pb.ConnGatewayReply{Ret: 200, Msg: value.Hello}, nil
}
